class CreateAssets < ActiveRecord::Migration
  def self.up
    create_table :assets do |t|
			t.integer  "parent_id"
		  t.string   "content_type", :limit=>30
		  t.string   "filename"
		  t.string   "thumbnail"
		  t.integer  "size"
		  t.integer  "width"
		  t.integer  "height"
		  t.string   "type", :limit=>30
		  t.integer  "user_id"
		  t.integer  "assetable_id"
		  t.string   "assetable_type", :limit=>30
		  t.boolean  "is_main"
      t.timestamps
    end
    
    add_index :assets, [:assetable_id, :assetable_type], :name=>"fk_assets"
    add_index :assets, [:parent_id], :name=>"fk_parent"
  end

  def self.down
    drop_table :assets
  end
end
